#ifndef __PVMDRIVER_SOFTMIX_H__
#define __PVMDRIVER_SOFTMIX_H__

#include "lib/drivers/pvmdriverinterface.h"
#include "lib/pvmsystem.h"

#include "lib/memory/pvmmemory.h"

#define PVM_DRIVER_WINMM_MAX_DEVICES	256

class PVMDeviceSimple;

class PVMDriverSimple : public IPVMDriverOut, public PVMAllocableObject
{
public:
	PVMDriverSimple(IPVMDriverOutSimpleDevice *simpleDriver);
	virtual ~PVMDriverSimple();

public:
	//should be called before other driver functions
	virtual pvm_bool Init();
	virtual void DriverClose();
	virtual pvm_bool IsInitialized();
	virtual pvm_uint32 GetDriverType();

	//return number of devices instaled in system
	virtual pvm_uint32 DevicesNum();
	//nDevice could be -1 for default device
	//set buffer to NULL to get name length (including termination zero)
	//maxLength - max buffer length including zero char
	//returns number of copied chars, -1 on error or 0 if buffer too small
	virtual pvm_int32 DeviceName(pvm_int32 nDevice, pvm_char* buffer, pvm_uint32 maxLength);
	virtual pvm_uint32 DeviceHardwareChanels(pvm_int32 deviceNumber);

	virtual pvm_bool DeviceEnumModes(pvm_int32 nDeivce, TFormatEnumCallbackProc enumProc, void *param);
	virtual IPVMDeviceOut* DeviceOpen(pvm_uint32 maxVoices, pvm_uint32 samplesPerSec, pvm_uint32 bitsPerSample, pvm_uint32 chanelsNum, pvm_int32 deviceNum, void *additionalInfo, pvm_uint32 infoSize);
	virtual void CloseDevice(IPVMDeviceBase* device);

	virtual pvm_bool GetDriverOption(const pvm_char* optionName, void* optionVal, pvm_uint32* optionSize);
	virtual pvm_bool SetDriverOption(const pvm_char* optionName, void* optionVal, pvm_uint32 optionSize);

	virtual void OnIdle();
protected:
	bool isDriverInitialized;

	IPVMDriverOutSimpleDevice *simpleDriver;
	PVMDeviceSimple* rootDevice;
};


#endif
